#include "allow-remove-data-settings.h"
#include "settings.h"

AllowRemoveDataSettings::AllowRemoveDataSettings() :
    QObject(), m_allowRemove(false)
{
    Settings settings;
    settings.beginGroup(staticMetaObject.className());
    m_allowRemove = settings.value("allowRemove", false).toBool();
}

AllowRemoveDataSettings::~AllowRemoveDataSettings()
{
}

bool AllowRemoveDataSettings::isRemovingAllowed() const
{
    return m_allowRemove;
}

void AllowRemoveDataSettings::setAllowRemove(bool allowed)
{
    if (m_allowRemove == allowed)
        return;

    m_allowRemove = allowed;
    emit allowRemoveChanged(m_allowRemove);
}

void AllowRemoveDataSettings::saveSettings()
{
    Settings settings;
    settings.beginGroup(staticMetaObject.className());
    settings.setValue("allowRemove", m_allowRemove);
}
